using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Gadgets.Setups
{
    public partial class eUsers : WeifenLuo.WinFormsUI.Docking.DockContent  
    {
        public eUsers()
        {
            InitializeComponent();
        }

        private void eUsers_Load(object sender, EventArgs e)
        {
            try
            {
                ABSCommonLibrary.CreateGridView(ref gridControl1);
            }
            catch (Exception ex)
            {
                ABSCommonLibrary.ShowErrorMessage(ex.ToString());
            }
        }

        private void eUsers_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {                
                if (e.KeyCode == Keys.F9)
                {
                    string user_name = string.Empty;
                    if (valueRow1.Cells["NAME"].Value != null)
                        user_name = valueRow1.Cells["NAME"].Value.ToString();
                    DataSet v_data = ABSCommonLibrary.DoInquiry(
                        CommonLibrary.CommonLibrary.BOSC019001, new object[2] { user_name, 0 });
                    gridControl1.SetDataBinding(v_data, v_data.Tables[0].TableName);
                }
            }
            catch (Exception ex)
            {
                ABSCommonLibrary.ShowErrorMessage(ex.ToString());
            }
        }
    }
}